package cn.isjinhao.crws.sql.grammar;

import cn.isjinhao.crws.sql.grammar.create.represention.Insert;
import cn.isjinhao.crws.sql.grammar.create.represention.InsertSetRep;
import cn.isjinhao.crws.sql.grammar.create.represention.OnDuplicateKey;
import cn.isjinhao.crws.sql.grammar.create.represention.ValuesRep;
import cn.isjinhao.crws.sql.grammar.retrieve.represention.Select;
import cn.isjinhao.crws.sql.grammar.retrieve.represention.SingleSelect;
import cn.isjinhao.crws.sql.grammar.retrieve.represention.column.ColumnRep;
import cn.isjinhao.crws.sql.grammar.retrieve.represention.column.ColumnSeg;
import cn.isjinhao.crws.sql.grammar.retrieve.represention.group.GroupBySeg;
import cn.isjinhao.crws.sql.grammar.retrieve.represention.limit.LimitSeg;
import cn.isjinhao.crws.sql.grammar.retrieve.represention.order.OrderBySeg;
import cn.isjinhao.crws.sql.grammar.retrieve.represention.table.TableRep;
import cn.isjinhao.crws.sql.grammar.retrieve.represention.table.TableSeg;
import cn.isjinhao.crws.sql.grammar.retrieve.represention.where.ExistsCondition;
import cn.isjinhao.crws.sql.grammar.retrieve.represention.where.InCondition;
import cn.isjinhao.crws.sql.grammar.retrieve.represention.where.RetrieveWhereSeg;

/**
 * @Author ISJINHAO
 * @Date 2021/3/2 20:12
 */
public interface CurdStatementVisitor<R> {

    default R accept(CurdStatement curdStatement) {
        return curdStatement.accept(this);
    }

    /**
     * select 语法的顶层观察方法
     */
    R visitSelect(Select select);

    R visitSingleSelect(SingleSelect singleSelect);

    R visitColumnSeg(ColumnSeg columnSeg);

    R visitColumnRep(ColumnRep columnRep);

    R visitTableSeg(TableSeg tableSeg);

    R visitTableRep(TableRep tableRep);

    R visitRetrieveWhereSeg(RetrieveWhereSeg retrieveWhereSeg);

    R visitInCondition(InCondition inCondition);

    R visitExistsCondition(ExistsCondition existsCondition);

    R visitGroupBySeg(GroupBySeg groupBySeg);

    R visitOrderBySeg(OrderBySeg orderBySeg);

    R visitLimitSeg(LimitSeg limitSeg);

    R visitLogic(Logic logic);

    R visitComparison(Comparison comparison);

    R visitBinaryArithmetic(BinaryArithmetic binaryArithmetic);

    R visitUnaryArithmetic(UnaryArithmetic unaryArithmetic);

    R visitLiteral(Literal literal);

    R visitGroupFunction(GroupFunction groupFunction);

    R visitGrouping(Grouping grouping);

    R visitIdentifier(Identifier identifier);

    R visitFunction(Function function);

    R visitValuesRep(ValuesRep valuesRep);

    R visitSetRep(InsertSetRep insertSetRep);

    R visitInsert(Insert insert);

    R visitEntryList(AssignmentList assignmentList);

    R visitOnDuplicateKey(OnDuplicateKey onDuplicateKey);

}

